<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/page/common/taglibs.jsp" %>
<html>
<head>
    <title>Title</title>
</head>
<input type="button" onclick="add(id)" value="添加"><br>
<input type="button" onclick="chang()" value="创建">
<body>
<table>
    <tr>
        <td>id</td>
        <td>考场名称</td>
        <td>参考人数</td>
        <td>上限</td>
        <td>考试状态</td>
<%--        <td>开始时间</td>--%>
<%--        <td>结束时间</td>--%>
        <td>详情</td>
    </tr>
    <tbody id="tb"></tbody>
</table>
</body>
<script type="text/javascript">
    $(function (){
        search();
    })

    function search(){
        $.post(
            "${ctx}/score/show",
            {},
            function (result){
                var html ="";
                for (var i = 0; i < result.data.length; i++) {
                    var sco = result.data[i];
                    html += '<tr>';
                    html+="<td><input type='checkbox' name='ids' value='"+sco.id+"'></td>"
                    html += '<td>'+sco.name+'</td>';
                    html += '<td>'+sco.num+'</td>';
                    html += '<td>'+sco.upper+'</td>';
                    html +='<td><input type="button" onclick="xiang()" value="详情"></td>'
                    // html += '<td>'+sco.startTime+'</td>';
                    // html += '<td>'+sco.endTime+'</td>';
                    html += '</tr>';
                }
                $("#tb").html(html);
            }
        );
    }


    function add(id){
        var check = $(":checked").val();
        layer.open({
            type: 2,
            area: ['500px', '300px'],
            content:"${ctx}/sco/toAdd?id="+check
        });
    }


    function chang() {
        layer.open({
            type:2,
            title:"考试创建",
            area:["300px","300px"],
            shadeClose:0.3,
            content:'${ctx}/sco/toAddSco'
        });
    }


</script>
</html>
